//
//  MyDemoTransitionTableVC.m
//  HDTransitonDemo
//
//  Created by mac on 2017/5/19.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "MyDemoTransitionTableVC.h"
#import "MyDemoCollectionVC.h"
#import "MyDemoTransitionVC.h"
#define CellReuseIdentifier @"CellReuseIdentifier"
@interface MyDemoTransitionTableVC (){
    
    NSArray *_demos;
}


@end

@implementation MyDemoTransitionTableVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"自定义动画";
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellReuseIdentifier];
    
    _demos = @[
               @"bubble",
               @"Push/Pop",
               ];

}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _demos.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellReuseIdentifier forIndexPath:indexPath];
    
    cell.textLabel.text = _demos[indexPath.row];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
        MyDemoTransitionVC *demoVC = [[MyDemoTransitionVC alloc] init];
        demoVC.demoType = indexPath.row;
        demoVC.navigationItem.title = _demos[indexPath.row];
        [self.navigationController pushViewController:demoVC animated:YES];
    } else {
        MyDemoCollectionVC *collectionVC = [[MyDemoCollectionVC alloc] init];
        collectionVC.navigationItem.title = _demos[indexPath.row];
        [self.navigationController pushViewController:collectionVC animated:YES];
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
